<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .container {
      width: 500px;
      height: 500px;
      background-color: orange;

      display: flex;
    }

    .item {
      width: 120px;
      height: 120px;

      flex-shrink: 0;
      /* 
        决定了flex items如何收缩(缩小)
          口可以设置任意非负数字(正小数、正整数、0(不压缩)),默认值是1
          口当flex items在main axis方向上超过了flex container的size,flex-shrink属性才会有效
        如果所有flex items的flex-shrink总和超过1,每个flex item收缩的size为
          口flex items超出flex container的size*收缩比例/所有flex items的收缩比例之和
        flex items扩展后的最终size不能超过max-width\max-height
      */
    }

    .item1, .item2 {
      flex-shrink: 1;
    }

    .item1 {
      min-width: 100px;
    }
  </style>
</head>
<body>
  
  <div class="container">
    <div class="item item1">1</div>
    <div class="item item2">2</div>
    <div class="item item3">3</div>
    <div class="item item4">4</div>
    <div class="item item5">5</div>
  </div>

  <script src="./js/itemRandomColor.js"></script>
</body>
</html>